home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 07 - 1991 / 07.11 Nov 91 / Jorg Sources / MacTutor7App.r < prev    next >
Encoding:
Text File  |  1991-09-22  |  5.7 KB  |  281 lines  |  [TEXT/MPS ]

  1. #include "SysTypes.r"
  2. #include "Types.r"
  3.  
  4. #define kPrefSize                60
  5. #define kMinSize                48
  6.     
  7. #define    kMinHeap                (34 * 1024)
  8. #define    kMinSpace                (20 * 1024)
  9.  
  10. /* id of our STR# for specific error strings */
  11. #define kErrStrings     129
  12.  
  13. /* Indices into STR# resources. */
  14. #define    eNoMemory                1
  15. #define    eNoWindow                2
  16.  
  17. #define    rMenuBar    128                /* application's menu bar */
  18. #define    rAboutAlert    128                /* about alert */
  19. #define    rDocWindow    128                /* application's window */
  20. #define    rVScroll    128                /* vertical scrollbar control */
  21. #define    rHScroll    129                /* horizontal scrollbar control */
  22.  
  23. #define    mApple                    128        /* Apple menu */
  24. #define    iAbout                    1
  25.  
  26. #define    mFile                    129        /* File menu */
  27. #define    iNew                    1
  28. #define    iClose                    4
  29. #define    iQuit                    12
  30.  
  31. #define    mEdit                    130        /* Edit menu */
  32. #define    iUndo                    1
  33. #define    iCut                    3
  34. #define    iCopy                    4
  35. #define    iPaste                    5
  36. #define    iClear                    6
  37.  
  38. #define    myMenu                    131        /* Sample menu */
  39. #define    item1                    1
  40. #define    item2                    2
  41. #define    item3                    3
  42. #define    item5                    5
  43.  
  44. resource 'vers' (1) {
  45.     0x01, 0x00, release, 0x00,
  46.     verUS,
  47.     "1.00",
  48.     "1.00, Copyright © 1989 J. Langowski / MacTutor"
  49. };
  50.  
  51. resource 'MBAR' (rMenuBar, preload) {
  52.     { mApple, mFile, mEdit, myMenu };        /* four menus */
  53. };
  54.  
  55.  
  56. resource 'MENU' (mApple, preload) {
  57.     mApple, textMenuProc,
  58.     0b1111111111111111111111111111101,    /* disable dashed line, enable About and DAs */
  59.     enabled, apple,
  60.     {
  61.         "About CPlusMacTutor7App…",
  62.             noicon, nokey, nomark, plain;
  63.         "-",
  64.             noicon, nokey, nomark, plain
  65.     }
  66. };
  67.  
  68. resource 'MENU' (mFile, preload) {
  69.     mFile, textMenuProc,
  70.     0b0000000000000000000100000000000,    /* program enables others */
  71.     enabled, "File",
  72.     {
  73.         "New",
  74.             noicon, "N", nomark, plain;
  75.         "Open",
  76.             noicon, "O", nomark, plain;
  77.         "-",
  78.             noicon, nokey, nomark, plain;
  79.         "Close",
  80.             noicon, "W", nomark, plain;
  81.         "Save",
  82.             noicon, "S", nomark, plain;
  83.         "Save As…",
  84.             noicon, nokey, nomark, plain;
  85.         "Revert",
  86.             noicon, nokey, nomark, plain;
  87.         "-",
  88.             noicon, nokey, nomark, plain;
  89.         "Page Setup…",
  90.             noicon, nokey, nomark, plain;
  91.         "Print…",
  92.             noicon, nokey, nomark, plain;
  93.         "-",
  94.             noicon, nokey, nomark, plain;
  95.         "Quit",
  96.             noicon, "Q", nomark, plain
  97.     }
  98. };
  99.  
  100. resource 'MENU' (mEdit, preload) {
  101.     mEdit, textMenuProc,
  102.     0b0000000000000000000000000000000,    /* program does the enabling */
  103.     enabled, "Edit",
  104.      {
  105.         "Undo",
  106.             noicon, "Z", nomark, plain;
  107.         "-",
  108.             noicon, nokey, nomark, plain;
  109.         "Cut",
  110.             noicon, "X", nomark, plain;
  111.         "Copy",
  112.             noicon, "C", nomark, plain;
  113.         "Paste",
  114.             noicon, "V", nomark, plain;
  115.         "Clear",
  116.             noicon, nokey, nomark, plain
  117.     }
  118. };
  119.  
  120. resource 'MENU' (myMenu, preload) {
  121.     myMenu, textMenuProc,
  122.     0b0000000000000000000000000000000,
  123.     enabled, "Strings",
  124.     {    /* array: 5 elements */
  125.         /* [1] */
  126.         "C++", noIcon, nokey, noMark, plain,
  127.         /* [2] */
  128.         "Sample", noIcon, nokey, noMark, plain,
  129.         /* [3] */
  130.         "Application", noIcon, nokey, noMark, plain,
  131.         /* [4] */
  132.         "-", noIcon, noKey, noMark, plain,
  133.         /* [5] */
  134.         "Have Fun", noIcon, nokey, noMark, plain
  135.     }
  136. };
  137.  
  138. /* the About screen */
  139.  
  140. resource 'ALRT' (rAboutAlert, purgeable) {
  141.     {40, 20, 190, 360 }, rAboutAlert, {
  142.         OK, visible, silent;
  143.         OK, visible, silent;
  144.         OK, visible, silent;
  145.         OK, visible, silent
  146.     };
  147. };
  148.  
  149. resource 'DITL' (rAboutAlert, purgeable) {
  150.     { /* array DITLarray: 5 elements */
  151.         /* [1] */
  152.         {120, 240, 140, 320},
  153.         Button {
  154.             enabled,
  155.             "OK"
  156.         },
  157.         /* [2] */
  158.         {8, 8, 24, 320 },
  159.         StaticText {
  160.             disabled,
  161.             "High-level event aware mini-application"
  162.         },
  163.         /* [3] */
  164.         {32, 8, 48, 320},
  165.         StaticText {
  166.             disabled,
  167.             "Copyright © 1991 J. Langowski / MacTutor"
  168.         },
  169.         /* [4] */
  170.         {56, 8, 72, 320},
  171.         StaticText {
  172.             disabled,
  173.             "[Based on examples by Apple MacDTS]"
  174.         },
  175.         /* [5] */
  176.         {80, 8, 112, 320},
  177.         StaticText {
  178.             disabled,
  179.             "Expand this application to your own taste"
  180.         }
  181.     }
  182. };
  183.  
  184.  
  185. resource 'WIND' (rDocWindow, preload, purgeable) {
  186.     {64, 60, 314, 460},
  187.     zoomDocProc, invisible, goAway, 0x0, "MacTutor System 7 demo"
  188. };
  189.  
  190.  
  191. resource 'CNTL' (rVScroll, preload, purgeable) {
  192.     {-1, 385, 236, 401},
  193.     0, visible, 0, 0, scrollBarProc, 0, ""
  194. };
  195.  
  196.  
  197. resource 'CNTL' (rHScroll, preload, purgeable) {
  198.     {235, -1, 251, 386},
  199.     0, visible, 0, 0, scrollBarProc, 0, ""
  200. };
  201.  
  202. resource 'STR#' (kErrStrings, purgeable) {
  203.     {
  204.     "Not enough memory to run MacTutor7App";
  205.     "Cannot create window";
  206.     }
  207. };
  208.  
  209. resource 'SIZE' (-1) {
  210.     dontSaveScreen,
  211.     acceptSuspendResumeEvents,
  212.     enableOptionSwitch,
  213.     canBackground,
  214.     multiFinderAware,
  215.     backgroundAndForeground,
  216.     dontGetFrontClicks,
  217.     ignoreChildDiedEvents,
  218.     is32BitCompatible,
  219.     isHighLevelEventAware, 
  220.     localAndRemoteHLEvents, 
  221.     reserved, reserved,
  222.     reserved, reserved, reserved,
  223.     kPrefSize * 1024,
  224.     kMinSize * 1024
  225. };
  226.  
  227.  
  228. type 'JLMT' as 'STR ';
  229.  
  230.  
  231. resource 'JLMT' (0) {
  232.     "HL Event aware C++ Application"
  233. };
  234.  
  235.  
  236. resource 'BNDL' (128) {
  237.     'JLMT',
  238.     0,
  239.     {
  240.         'ICN#',
  241.         {
  242.             0, 128
  243.         },
  244.         'FREF',
  245.         {
  246.             0, 128
  247.         }
  248.     }
  249. };
  250.  
  251.  
  252. resource 'FREF' (128) {
  253.     'APPL',
  254.     0,
  255.     ""
  256. };
  257.  
  258. resource 'ICN#' (128) {
  259.     {    /* array: 2 elements */
  260.         /* [1] */
  261.         $"00 01 80 00 00 07 E0 00 00 1F F8 00 00 7F FE 00"
  262.         $"01 FF FF 80 07 FF FF E0 0F FF 0F F8 07 FF 33 FC"
  263.         $"03 FF FC 38 06 FF FF C8 0C 3F FF FE 08 0F FF D6"
  264.         $"08 03 FF 96 08 F0 FF 19 09 F8 3E 16 09 88 0C 19"
  265.         $"08 00 00 16 08 00 00 10 0B 1E 78 D0 0B FF FF D0"
  266.         $"09 FF FF 90 FC 7E 7E 3E 96 00 00 6A D3 FF FF CA"
  267.         $"52 00 00 4A 53 FF FF CB A6 38 70 69 DC 44 88 3F"
  268.         $"1F 38 73 98 38 87 04 4C 67 08 83 86 7F FF FF FE",
  269.         /* [2] */
  270.         $"00 07 E0 00 00 1F F8 00 00 7F FE 00 01 FF FF 80"
  271.         $"07 FF FF E0 1F FF FF F8 1F FF FF FC 0F FF FF FE"
  272.         $"07 FF FF FC 07 FF FF F8 0F FF FF FE 0F FF FF FE"
  273.         $"0F FF FF FE 0F FF FF FF 0F FF FF FE 0F FF FF FF"
  274.         $"0F FF FF F6 0F FF FF F0 0F FF FF F0 0F FF FF F0"
  275.         $"0F FF FF F0 FF FF FF FE F7 FF FF EE F3 FF FF CE"
  276.         $"73 FF FF CE 73 FF FF CF E7 FF FF EF DF FF FF FF"
  277.         $"1F FF FF F8 7F FF FF FE FF FF FF FF FF FF FF FF"
  278.     }
  279. };
  280.  
  281.